package org.yang.plugins.resource.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
import org.yang.plugins.resource.serializer.Auth2ExceptionSerializer;

/**
 *  自定义OAuth2 异常
 *
 * @author: lslands
 * @version: v2.0
 * @create: 2021/6/14 21:56
 **/
@JsonSerialize(using = Auth2ExceptionSerializer.class)
public class Auth2Exception extends OAuth2Exception {

    private String errorCode;

    public Auth2Exception(String msg) {
        super(msg);
    }

    public Auth2Exception(String msg, String errorCode) {
        super(msg);
        this.errorCode = errorCode;
    }

    public String getErrorCode() {
        return errorCode;
    }
}
